﻿
@model RegionEntity
@{
    ViewData["Title"] = "区域 编辑";
    Layout = "../Shared/_Layout.cshtml";
}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content text-center p-md">
                    <form id="dynamic-form" asp-action="Edit" method="post" class="form-horizontal" role="form">
                        <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                        <input type="hidden" asp-for="RegionId" />

                        <div class="form-group">
                            <label asp-for="RegionCode" class="col-md-3 control-label text-right"> 编码</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionCode" class="form-control" validate="{required:true ,maxlength:100   }" />
                                </div>
                                <span asp-validation-for="RegionCode" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="RegionName" class="col-md-3 control-label text-right"> 名称</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionName" class="form-control" validate="{required:true ,maxlength:100   }" />
                                </div>
                                <span asp-validation-for="RegionName" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="ParentCode" class="col-md-3 control-label text-right"> 上级</label>
                            <div class="col-md-9   text-left">
                                <div class="input-group m-b text-left col-md-12 select2-region-group" data-bind-level="1"  data-bind-input="#ParentCode">
                                    <span class="input-group-addon"></span>
                                    <input type="hidden" asp-for="ParentCode" />
                                    <select class="col-md-4 select2-region-group-item"> </select>
                                    <select class="col-md-4 select2-region-group-item"> </select>
                                  
                                </div>
                                <span asp-validation-for="ParentCode" class="text-danger"></span>
                            </div>


                        </div>
                    
                        <div class="form-group">
                            <label asp-for="RegionLevel" class="col-md-3 control-label text-right"> 级别</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionLevel" class="form-control" validate="{required:true ,IsInt:true    }" />
                                </div>
                                <span asp-validation-for="RegionLevel" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="RegionOrder" class="col-md-3 control-label text-right"> 排序</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionOrder" class="form-control" validate="{required:true ,IsInt:true    }" />
                                </div>
                                <span asp-validation-for="RegionOrder" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="RegionNameEn" class="col-md-3 control-label text-right"> 英文名称</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionNameEn" class="form-control" validate="{required:true ,maxlength:100   }" />
                                </div>
                                <span asp-validation-for="RegionNameEn" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="RegionShortNameEn" class="col-md-3 control-label text-right">简称</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionShortNameEn" class="form-control" validate="{required:true    }" />
                                </div>
                                <span asp-validation-for="RegionShortNameEn" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="RegionPath" class="col-md-3 control-label text-right"> 深度</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="RegionPath" class="form-control" validate="{required:true ,maxlength:50   }" />
                                </div>
                                <span asp-validation-for="RegionPath" class="text-danger"></span>
                            </div>
                        </div>                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <a class="btn btn-white" asp-action="index" >返  回</a>

                                <button class="btn btn-primary" type="submit">保存</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@section scripts{
    <script type="text/javascript">
    $(function () {
        $(document).ready(function () {
            $(".form-horizontal").CustomForm({
                isValidate: true,
                isTable: false
            });
            $(".form-horizontal").submit(function () {
                if (!$(".form-horizontal").valid())
                {
                    return false;
                }
            });
	  });
    });
    </script>
}